'use strict';
var router = require('express').Router();
var AV = require('leanengine');

var User = AV.Object.extend('_User');
var WxUser = AV.Object.extend('WxUser');


router.post('/', function(req, res, next) {
  var wxid = req.body.wxid;
  var wxuser = new WxUser();
  wxuser.set('wx_id',wxid);
  wxuser.save().then(function(){
    res.redirect('/todos');
  });
});

module.exports = router;
